<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
<%@ attribute name="name" type="java.lang.String" required="true" description="隐藏域名称（ID）"%>
<%@ attribute name="value" type="java.lang.String" required="true" description="隐藏域值（ID）"%>
<%@ attribute name="labelName" type="java.lang.String" required="true" description="输入框名称（Name）"%>
<%@ attribute name="labelValue" type="java.lang.String" required="true" description="输入框值（Name）"%>

<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择，如果限制，设置为disabled"%>
<script type="text/javascript">
    function searchGrid${id}(){
        top.layer.open({
            type: 2,
            area: ['800px', '500px'],
            title:"${title}",
            name:'friend',
            content: "${url}",
            btn: ['确定', '关闭'],
            yes: function(index, layero){
                var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                var item = iframeWin.getSelectedItem();

                if(item == "-1"){
                    return;
                }
                confFireDutyScheduleList{{idx}}_id
                $("#${id}_idId").val(item.split('_item_')[0]);
                $("#${id}_idName").val(item.split('_item_')[1]);
                $("#${id}_startTime").val(item.split('_item_')[2]);
                $("#${id}_endTime").val(item.split('_item_')[3]);
                top.layer.close(index);//关闭对话框。
            },
            cancel: function(index){
            }
        });
    };
</script>
<input id="${id}_idId" name="${name}"  type="hidden" value="${value}"/>
<div class="input-group">
    <input id="${id}_idName"  name="${labelName }" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
           class="${cssClass}" style="${cssStyle}"/>
    <span class="input-group-btn">
	       		 <button type="button" onclick="searchGrid${id}()" id="${id}Button" class="btn <c:if test="${fn:contains(cssClass, 'input-sm')}"> btn-sm </c:if><c:if test="${fn:contains(cssClass, 'input-lg')}"> btn-lg </c:if>  btn-primary ${disabled} ${hideBtn ? 'hide' : ''}"><i class="fa fa-search"></i>
	             </button>
       		 </span>

</div>
<label id="${id}Name-error" class="error" for="${id}_idName" style="display:none"></label>
